1. Field of the Invention
The present invention relates to an electronic control apparatus having a self-diagnosis function.
2. Description of Related Art
As described in Japanese Patent No. 3659017, it is known to provide an electronic control apparatus mounted on a vehicle with a self-diagnosis function. The self-diagnosis function is such a function that periodically checks operating states of sensors or the like, lights a warning light upon detecting malfunction to inform a user of the malfunction, and, in response to an external diagnostic device, outputs one of diag codes, that shows a kind of the malfunction to this external diagnostic device. Such diag codes are stored in a RAM included in the electronic control apparatus, the RAM being always supplied with an operating voltage from a battery.
However, the diag codes stored in the RAM may be erased when a command to erase the diag codes is inputted into the electronic control apparatus form the external diagnostic device, or when the operating voltage of the RAM is removed (for example, when the battery is removed).
Accordingly, a regulation requiring such diag codes to be stored in a nonvolatile memory (EEPROM, for example) is scheduled to be issued. This regulation allows to erase, from the nonvolatile memory, diag codes for items each of which has been determined to be normal successively for a plurality of trip periods (which are referred to as “normally recovered items” hereinafter). Here, the trip period means a driving cycle of a vehicle (for example, a period between an on-timing of a ignition switch and the next on-timing of the ignition switch).
Incidentally, some diag codes are commonly used for a plurality of different items. For example, a certain diag code is used to indicate that there is disconnection or short-circuit in a certain sensor, and also to indicate that the output value of this sensor is abnormal. For another example, a certain diag code is used to indicate occurrence of a misfire in common for a plurality of engine cylinders. In this example, although it can be detected that a misfire has occurred, it cannot be detected in which cylinder the misfire has occurred.
Accordingly, in a case where such a diag code is stored in a plurality of different addresses of the nonvolatile memory so as to correspond to a plurality of different items in a one-to-one relation, when one of these items is determined to be a “normally recovered item”, it may become impossible to determine which of these diag codes stored in the different addresses may be erased.